
# Setting the prefix from C-b to C-a
set -g prefix C-a

# Free the original Ctrl-b prefix keybinding
unbind C-b

#setting the delay between prefix and command
set -sg escape-time 1

# Ensure that we can send Ctrl-A to other apps
bind C-a send-prefix

# Set the base index for windows to 1 instead of 0
set -g base-index 1

# Set the base index for panes to 1 instead of 0
#setw -g pane-base-index 1

# Reload the file with Prefix r
#bind r source-file /etc/tmux.conf \; display "/etc/tmux.conf Reloaded!"

# splitting panes
bind | split-window -h
bind - split-window -v


# Set the default terminal mode to 256color mode
# -- set -g default-terminal "screen-256color"
# -- set -g default-terminal "xterm-256color"

# [2023-11-23] Comparison of TERM value "screen" and "xterm".
# "screen": 
# Benefits:
# 	Keypress Home/End can go to start/end of command line.
#
# "xterm":
# Benefits:
# 	When running iftop, "xterm" shows correct box-drawing characters.
set -g default-terminal "screen-256color"

# enable activity alerts
set -g monitor-activity on
set -g visual-activity on

# set the status line's colors
set -g status-fg white
set -g status-bg blue

# set the color of the window list
	#setw -g window-status-fg white
	#setw -g window-status-bg default
	#setw -g window-status-attr dim

# set colors for the active window
set -g window-status-current-style "bg=red fg=brightwhite"
	#setw -g window-status-current-fg white
	#setw -g window-status-current-bg red
	#setw -g window-status-current-attr bright

# pane colors
	#set -g pane-border-fg green
	#set -g pane-border-bg black
	#set -g pane-active-border-fg white
	#set -g pane-active-border-bg yellow

# Command / message line
	#set -g message-fg white
	#set -g message-bg black
	#set -g message-attr bright

# Status line left pane
set -g status-left-length 40
set -g status-left "#[bg=white]#[fg=black] #S "

# tmux v2.2 has removed "status-utf8" option, and will cause a warning on start-up.
#set -g status-utf8 on

# Status line right pane, display null
set -g status-right ""

# disable 15-second status line refresh, so that, when you are viewing 
# history buffer on terminal(PuTTY etc), you will not be dragged to bottom
# due to terminal activity.
set -g status-interval 0

# [2024-01-23] set scroll buffer to 9999
set -g history-limit 9999

# Mouse action
#setw -g mode-mouse on
  # [2020-03-14] In tmux 2.7, this changes to `set -g mouse on`
#set -g mouse-select-pane on
  # [2013-03-26] Note, When in 'C-a [' (copy-mode), Putty cannot use mouse to select and copy text,
  # --unless you Shift+drag mouse. So I comment out "mode-mouse on" and "mouse-select-pane on".
#set -g mouse-resize-pane on
#set -g mouse-select-window on

# Chj:
bind -n F12 choose-session
bind -n F10 last-window
bind -n F9 next-window
bind -n F8 previous-window

bind -n F11 command-prompt -p 'save screen buffer to file:' -I '~/tmuxbuffer.txt' 'capture-pane -J -S -32768 ; save-buffer %1 ; delete-buffer'
  # [tmux 1.5] F11: Save scroll-back buffer to a file.

#bind -n C-o down-pane
  # This is for tmux 1.2 
bind -n C-o select-pane -t :.+
  # This is for tmux 1.3 and later

